﻿using FireChat.Client.Model.Message.Concrete;

namespace FireChat.Client.Model.Message.Util;


/// <summary>
/// 消息脚手架
/// </summary>
internal static class MessageScaffold
{
    /// <summary>
    /// 获取所有文本消息
    /// </summary>
    public static string GetTextMessage(this MessageChain chain)
    {
        var texts = from i in chain
                    let text = i as TextMessage
                    where text != null
                    select text.Text;

        return string.Join("", texts);
    }
}
